tooltip: Don't play games with max-width-chars
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jan 2023 18:04:01 +0000 (13:04 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jan 2023 18:06:30 +0000 (13:06 -0500)
commitdce21f06ddbab1cdbd25621897df32b472fd72c7
treebd6a632a8765e8f26c406954d989f1f1718abff3
parent56c1c4152f41c625f09937ee60098e1a3dfe3ba4
tooltip: Don't play games with max-width-chars

Setting max-width-chars to the number of characters
in the string works ok only as long as the average
char width we get from Pango matches reality. Sadly
that seems not always the case, and this code was
causing short Chinese tooltips to always be broken
into two lines.

Fixes: #4470
gtk/gtktooltipwindow.c
gtk/ui/gtktooltipwindow.ui